<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:replace="tpl :: common_head()"></th:block>
    <title>订单管理</title>
</head>
<body th:with="entrance='/system/orderManagement/index'">
<th:block th:replace="tpl :: common_body(~{::.main-right})">
    <div class="main-right">
        <h1 class="main-right-h1">订单管理列表</h1>
        <ul class="main-right-tab">
            <li class="selected">列表</li>
        </ul>
        <form method="GET" th:object="${query}">
            <div class="main-right-search-group">
                <div class="main-right-search">
                    <label>订单编号</label>
                    <input type="text" th:field="*{code}"/>
                </div>
                <div class="main-right-search">
                    <label>产废单位名称</label>
                    <input type="text" th:field="*{productWasteName}"/>
                </div>
            </div>
            <div class="main-right-search-group">
                <div class="main-right-search">
                    <label>经营单位名称</label>
                    <input type="text" th:field="*{manageName}"/>
                </div>
                <div class="main-right-search">
                    <label>运输单位名称</label>
                    <input type="text" th:field="*{transportName}"/>
                </div>
                <div class="main-right-search">
                    <label>状态</label>
                    <select th:field="*{state}">
                        <option value="">未选择</option>
                        <option th:each="obj : ${@dictService.getByType('child_order_state')}" th:value="${obj.value}"
                                th:text="${obj.label}"></option>
                    </select>
                </div>
            </div>
            <button type="submit" class="main-right-search-submit">搜&emsp;索</button>
            <div class="panel">
                <table class="table">
                    <thead>
                    <tr>
                        <th>操作</th>
                        <th>订单编号</th>
                        <th>产废单位名称</th>
                        <th>经营单位名称</th>
                        <th>运输单位名称</th>
                        <th>状态</th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr th:each="obj : ${page.content}" th:object="${obj}">
                        <td>
                            <a th:href="'javascript:show('+*{id}+');'">详情</a>&nbsp;
                        </td>
                        <td th:text="*{code}"></td>
                        <td th:text="*{productWasteName}"></td>
                        <td th:text="*{manageName}"></td>
                        <td th:text="*{transportName}"></td>
                        <td th:text="*{@dictService.getByTypeAndValue('child_order_state',state)}"></td>
                    </tr>
                    </tbody>
                </table>
            </div>
            <div th:replace="tpl :: pagination(${page})"></div>
        </form>
    </div>
</th:block>
<script type="text/javascript">

    function updatePsw(id) {
        layer.confirm('确定重置密码吗？', {
            title: '提示'
        }, function (index) {
            window.location.href = "updatePsw?id=" + id;
            layer.close(index);
        });
    }

    function deletes(id) {
        layer.confirm('确定删除?', {
            title: '提示',
            btn: ['确定', '取消']
        }, function (index) {
            window.location.href = "delete?id=" + id;
            layer.load();
        });
    }

    function reject(id) {
        layer.prompt({
            title: '驳回理由'
        }, function (value, index, elem) {
            window.location.href = "exam?id=" + id + "&type=2&rejectReason=" + value;
            layer.close(index);
        });
    }
    function show(id) {
        layer.open({
            type: 2,
            content:'info/'+id,
            area: ['600px', '700px'],
            shade: 0.6,
            scrollbar: false,
            fixed: true,
            maxmin: true
            //这里content是一个URL，如果你不想让iframe出现滚动条，你还可以content: ['http://sentsin.com', 'no']
        });
    }
</script>
</body>
</html>